﻿namespace EFS.RC.CC.CH.Tables
{
	public static class UserActivity
	{
		/// Create
		public static System.Int32? Create(
			System.DateTime occurred,
			System.Guid userADGuid,
			System.Int64 activityCode,
			System.String customActivityDescription,
			EFS.DB.Connection connection)
		{
			// check
			EFS.Common.Verify.Reference(connection, "connection");

			// make params
			EFS.DB.Parameters.Array parametersArray = new EFS.DB.Parameters.Array(
				new System.String[] { "occurred", "user_ad_guid", "activity_code", "custom", "id" },
				new System.Object[] { occurred, userADGuid, activityCode, customActivityDescription, default(System.Int32) },
				new System.Boolean[] { false, false, false, false, true });
			
			// exec create
			connection.DoExecuteNonQuery("[dbo].[UserActivity_Create]", parametersArray);

			// get id value
			return parametersArray.GetOutPrameterValue<System.Int32?>("id"); 
		}
	}

}